<!DOCTYPE html>
<html>
<#include "../head.html">
    <body class="full">
    <div class="mc">
        <div class="mc-l">
            <!--左侧导航---{-->
            <div id="navPanelContainer">
                <div class="system-logo cd"></div>
                <!--管理员信息---{-->
                <#include "../../adminInfo.html">
                    <!--管理员信息---}-->
                    <div class="nav-wrap">
                        <#include "../left.html">
                    </div>
            </div>
            <!--左侧导航---}-->
        </div>
        <div class="mc-m">
            <div class="navToggle"></div>
        </div>
        <div class="mc-r">
            <!--顶部导航---{-->
            <#include "../topNav.html">
                <!--顶部导航---}-->

                <!--面包屑导航---{-->
                <#assign moduleName="新增文章">
                    <#include "banner.html">
                        <!--面包屑导航---}-->

                        <!--工具栏--{-->
                        <div id="toolbar" class="clearfix">
                            <div class="toolbor-module">
                                <a class="input-button" href="#" onclick="location.href='showArticle.html'">返回</a>
                                <!--  <a class="input-button" href="addSite.html" style="line-height:24px;">添加子栏目</a> -->
                            </div>
                        </div>
                        <!--工具栏--}-->

                        <div id="main" class="w750 clearfix">

                            <form name="form1" method="post" action="" onsubmit="return check_form();" enctype="multipart/form-data" >
                                <div class="valBox">
                                    <div class="top">
                                        <strong>新增文章</strong>
                                    </div>
                                    <div class="clearfix">
                                        <ul class="title-v edit">
                                            <li>
                                                <div class="title">标题：</div>
                                                <div class="v">
                                                    <input type="text" name="name"  class="input_border" value="" size="30" />
                                                    <label><input type="checkbox" onclick="jump_url()"  name="isJump" value="1"/> 跳转</label>
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">栏目英文标识：</div>
                                                <div class="v">
                                                    <input type="text" name="ename"  class="input_border" value="" size="30" />
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">定义属性：</div>
                                                <div class="v">
                                                    <label> <input type='checkbox' name='flag' value='t' >推荐</label>
                                                    <label><input type='checkbox' name='flag' value='h' >头条</label>
                                                    <#--   <label><input type='checkbox' name='flag' value='f' >幻灯片</label>-->
                                                </div>
                                            </li>
                                            <li style="display:none" id="jump_url">
                                                <div class="title">跳转网址：</div>
                                                <div class="v">
                                                    <input type="text" name="jumpurl"  class="input_border" value="" size="30" />
                                                </div>
                                            </li>
                                            <li>
                                                <div class="title">所属栏目：</div>
                                                <div class="v">
                                                    <!-- <@siteDirect name="siteId" ></@siteDirect> -->
                                                    <!-- <#if list??>
                                                     <select name="siteId">
                                                         <option value="0">请选择</option>
                                                         <#list list as item>
                                                         <option value="${item.siteId}">${item.name}</option>
                                                         </#list>
                                                     </select>
                                                     </#if> -->
                                                    <!-- Site中加上fid的 -->
                                                    <@siteWithFidDirect name="siteId" fid="${fid}"></@siteWithFidDirect>
                                    </div>
                                    </li>
                                    <li>
                                        <div class="title">文章来源：</div>
                                        <div class="v">
                                            <input type="text" name="source"  class="input_border" value="" size="30" />
                                        </div>
                                    </li>
                                    <li>
                                        <div class="title">作者：</div>
                                        <div class="v">
                                            <input type="text" name="author"  class="input_border" value="" size="30" />

                                        </div>
                                    </li>
                                    <li>
                                        <div class="title">发布时间：</div>
                                        <div class="v">
                                            <input type="text" name="publish"  class="input_border" value="${dateformat("nowDate")?string('yyyy-MM-dd HH:mm:ss')}" size="30" onclick="change_picktime('yyyy-MM-dd HH:mm:ss')" readonly=""/>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="title">状态：</div>
                                        <div class="v">
                                            <label><input type="radio" name="status" value="0"  checked="checked"/>隐藏</label>
                                            <label><input type="radio" name="status" value="1"  checked="checked"/>显示</label>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="title">排序：</div>
                                        <div class="v">
                                            <input type="text" name="sort"  class="input_border" value="10" size="10" />
                                        </div>
                                    </li>
                                    <li>
                                        <div class="title">内容简介：</div>
                                        <div class="v">
                                            <textarea name="summary" cols="45" rows="5"></textarea>
                                        </div>
                                    </li>
                                    <script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/kindeditor-min.js"></script>
                                    <script charset="utf-8" src="${request.getContextPath()}/plugins/editor/kindeditor/lang/zh_CN.js"></script>
                                    <li>
                                        <div class="title">内容：</div>
                                        <div class="v">
                                            <#include "../../common/ueditor.html">
                                                <@showUeditor width=680 heigth=100 id="content" name="content" content="" />
                                        </div>
                                    </li>
                                    <li>
                                        <div class="title">上传文件：</div>
                                        <div class="v">
                                            <input type='file' name='files' value='' size='20' id='files'>
                                        </div>
                                    </li>

                                    </ul>
                                </div>

                        </div>

                        <div id="bottomToolbar" class="clearfix">
                            <input type="hidden"  name="actionType" value="addArticle" />
                            <input class="input-button post" type="submit"  name="Submit" value="提交" />
                            <input class="input-button reset" type="reset"  name="reset" value="重置" />
                        </div>
                        </form>
        </div>
        <script>

            function check_form(){
                var frm = document.forms['form1'];
                var name = frm.elements['name'].value;
                var content = frm.elements['content'].value;
                var errorMsg = '';
                if (name.length == 0 ) {
                    errorMsg += '标题必须填写' + '\n';
                }

                if (errorMsg.length > 0){
                    alert(errorMsg); return false;
                } else{
                    return true;
                }
            }

            function jump_url(){
                if (document.getElementById('jump_url').style.display == ""){
                    document.getElementById('jump_url').style.display = "none";
                    document.getElementById('jump_id').style.display = "";
                }else{
                    document.getElementById('jump_url').style.display = "";
                    document.getElementById('jump_id').style.display = "none";
                }
            }
        </script>
        </div>
    </div>
    <div class="msgClass">
        ${rsmsg!""}
    </div>
    <#include "../jsPage.html">
    </body>
</html>
